<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>信号配时建议</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../libs/layui/css/layui.css" media="all">
    <style>
        .optimization-container {
            padding: 20px;
            background-color: #f2f2f2;
            min-height: 100vh;
        }
        
        .header-info {
            background: #fff;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .suggestion-card {
            background: #fff;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 15px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            border-left: 4px solid #009688;
        }
        
        .suggestion-card.high-priority {
            border-left-color: #ff5722;
        }
        
        .suggestion-card.medium-priority {
            border-left-color: #ff9800;
        }
        
        .action-buttons {
            text-align: center;
            margin-top: 30px;
        }
    </style>
</head>
<body>
    <div class="optimization-container">
        <!-- 头部信息 -->
        <div class="header-info">
            <div class="layui-row">
                <div class="layui-col-md8">
                    <h2><i class="layui-icon layui-icon-set"></i> 信号配时优化建议</h2>
                    <p class="layui-text-gray">当前优化交叉口：<strong>人民路-解放路交叉口</strong></p>
                    <p class="layui-text-gray">当前信号周期：<strong>120秒</strong> | 最后更新时间：<strong>2024-01-15 14:30:25</strong></p>
                </div>
                <div class="layui-col-md4 layui-text-right">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <h4>优化状态</h4>
                            <span class="layui-badge layui-bg-green">运行中</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 优化建议卡片 -->
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md6">
                <div class="suggestion-card high-priority">
                    <h3><i class="layui-icon layui-icon-flag"></i> 南向直行</h3>
                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <p><strong>建议操作：</strong></p>
                            <p class="layui-text-red">绿灯时长延长 15 秒</p>
                            <p><strong>当前时长：</strong>30秒</p>
                            <p><strong>建议时长：</strong>45秒</p>
                        </div>
                        <div class="layui-col-md6">
                            <p><strong>配时理由：</strong></p>
                            <p class="layui-text-gray">预测该方向未来10分钟内车流量将增长20%，当前排队长度已达临界值</p>
                            <p><strong>优先级：</strong><span class="layui-badge layui-bg-red">高</span></p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="layui-col-md6">
                <div class="suggestion-card medium-priority">
                    <h3><i class="layui-icon layui-icon-flag"></i> 东向左转</h3>
                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <p><strong>建议操作：</strong></p>
                            <p class="layui-text-orange">绿灯时长延长 8 秒</p>
                            <p><strong>当前时长：</strong>25秒</p>
                            <p><strong>建议时长：</strong>33秒</p>
                        </div>
                        <div class="layui-col-md6">
                            <p><strong>配时理由：</strong></p>
                            <p class="layui-text-gray">左转车辆排队长度增加，预计未来5分钟需求上升</p>
                            <p><strong>优先级：</strong><span class="layui-badge layui-bg-orange">中</span></p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="layui-col-md6">
                <div class="suggestion-card">
                    <h3><i class="layui-icon layui-icon-flag"></i> 北向直行</h3>
                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <p><strong>建议操作：</strong></p>
                            <p class="layui-text-green">维持当前配时</p>
                            <p><strong>当前时长：</strong>35秒</p>
                            <p><strong>建议时长：</strong>35秒</p>
                        </div>
                        <div class="layui-col-md6">
                            <p><strong>配时理由：</strong></p>
                            <p class="layui-text-gray">车流量稳定，当前配时已满足通行需求</p>
                            <p><strong>优先级：</strong><span class="layui-badge layui-bg-green">低</span></p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="layui-col-md6">
                <div class="suggestion-card">
                    <h3><i class="layui-icon layui-icon-flag"></i> 西向右转</h3>
                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <p><strong>建议操作：</strong></p>
                            <p class="layui-text-blue">绿灯时长缩短 5 秒</p>
                            <p><strong>当前时长：</strong>30秒</p>
                            <p><strong>建议时长：</strong>25秒</p>
                        </div>
                        <div class="layui-col-md6">
                            <p><strong>配时理由：</strong></p>
                            <p class="layui-text-gray">右转车流量下降，可适当缩短绿灯时间优化整体效率</p>
                            <p><strong>优先级：</strong><span class="layui-badge layui-bg-blue">低</span></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 操作按钮 -->
        <div class="action-buttons">
            <button class="layui-btn layui-btn-lg layui-btn-normal" onclick="previewOptimization()">
                <i class="layui-icon layui-icon-eye"></i> 预览优化效果
            </button>
            <button class="layui-btn layui-btn-lg layui-btn-warm" onclick="applyOptimization()">
                <i class="layui-icon layui-icon-ok"></i> 采纳建议
            </button>
            <button class="layui-btn layui-btn-lg layui-btn-primary" onclick="resetOptimization()">
                <i class="layui-icon layui-icon-refresh"></i> 重新分析
            </button>
        </div>
    </div>

    <script src="../../libs/layui/layui.js"></script>
    <script>
        layui.use(['layer'], function(){
            var layer = layui.layer;
            
            // 预览优化效果
            window.previewOptimization = function() {
                layer.msg('正在生成优化预览...', {icon: 16, time: 2000});
                setTimeout(function() {
                    layer.open({
                        type: 1,
                        title: '优化效果预览',
                        area: ['800px', '500px'],
                        content: '<div style="padding: 20px;"><h3>优化后的信号配时方案</h3><p>南向直行：45秒（+15秒）</p><p>东向左转：33秒（+8秒）</p><p>北向直行：35秒（维持）</p><p>西向右转：25秒（-5秒）</p><p><strong>预计效果：</strong>通行效率提升15%，平均等待时间减少20%</p></div>'
                    });
                }, 2000);
            };
            
            // 采纳建议
            window.applyOptimization = function() {
                layer.confirm('确定要采纳这些优化建议吗？', {
                    icon: 3,
                    title: '确认操作'
                }, function(index) {
                    layer.msg('正在应用优化方案...', {icon: 16, time: 3000});
                    setTimeout(function() {
                        layer.msg('优化方案已成功应用！', {icon: 1});
                    }, 3000);
                    layer.close(index);
                });
            };
            
            // 重新分析
            window.resetOptimization = function() {
                layer.msg('正在重新分析交通状况...', {icon: 16, time: 2000});
                setTimeout(function() {
                    layer.msg('分析完成，已更新优化建议', {icon: 1});
                }, 2000);
            };
        });
    </script>
</body>
</html>
